home *** CD-ROM | disk | FTP | other *** search
- Short: ASAP - Amiga Software Authoring Platform
- Author: hfx@fox.nstn.ca
- Uploader: hfx@fox.nstn.ca
- Version: 1.0 beta (final beta)
- Type: dev/c
- Requires: Storm or SAS C++. GNUC++ support is being investigated
-
- What: Zero overhead, inlined C++ wrapper classes for the Amiga API.
- A collection of 90 header files, each having one class which derive
- from the corresponding Amiga system structure, adding no data members,
- only inlined methods which call the corresponding global prototype
- substituting the 'this' pointer for the structure pointer.
-
- Why: I'm a C++ programmer, and I think in terms of objects. The Amiga API
- is a "flat" API. It helps me, and I hope many of you, to categorize these
- functions into "classes" or "categories". Many of you may be concerned about
- overhead using these. See below, there is absolutely *no* overhead. There are
- several benefits, including fewer bugs, such as CloseWindow(pNotAWindow); Also,
- if you want to work with a Window, or RastPort, for instance, you needn't worry
- about what include's you need, just:
-
- #include <ASAP/Window.h>
- #include <ASAP/RastPort.h>
-
- How: A tool called ClassBuilder which I wrote for this purpose.
-
- When: Part time work started in late January.
-
- How it works: Firstly, there is no run time overhead when your compiler allows
- inline optimization. In effect, these are a lot of #define's. As far
- as storage is concerned, these classes *are* the Amiga structures.
- You can treat these classes 100% as if they were the Amiga structures,
- because ultimately, they are.
-
- Consider a structure, "Structure". There are some functions
- which operate upon it, for example OpenStructure(Structure *) and
- CloseStructure(Structure *). To simplify this for the beginner and
- those who grow tired of typing, I write the following code:
-
- class AStructure : public Structure
- {
- public:
- void Open() { ::OpenStructure(this); }
- void Close() { ::CloseStructure(this); }
- };
-
- Now the instance is tied to its methods, and there is less typing.
- Also, I have overloaded operator new and delete where desirable.
- Now you can create/destroy a window as follows:
-
- AWindow *pThis_Window = new(&The_NewWindow) AWindow;
- delete pThis_Window;
-
- instead of:
-
- struct Window *pThis_Window = OpenWindow(&The_NewWindow);
- CloseWindow(pThis_Window);
-
- Updates: These have all been compiled, but there might be one or two
- logic errors (perhaps in the more obscure classes).
-
- Second version of the collection with abbreviated names for
- those who do not mind alias of the Amiga API functions.
-
- eg. pThis_Window->Zip(); // instead of pThis_Window->ZipWindow();
-
- Also, default parameters, where the OS defines special parameter
- values or they are otherwise meaningful, must be added.
-
- Future: This collection is fairly comprehensive, but not complete. I'm relying
- on you for feedback. Also, this is just phase I. I've got some nice code
- built on top of this to allow simple, dynamic IDCMP/Boopsi event handling
- (dispatching) which I hope to release some time this summer.
-
- Important:
-
- Please, please email me if you have any problems or suggestions/complaints.
-
- In SAS/C++, create a directory called ASAP in your cxxinclude directory
- Decompress the archive into this directory.
-
- In Storm C, create a directory as above, but put it whereever you want,
- only make certain the directory is in your include path.
-
- The files should be reachable by, for example:
-
- #include <ASAP/Window.h>
-
- Sorry, there is no example in this archive, but I will post one or
- more soon.
-